FROM --platform=$TARGETPLATFORM registry.cn-zhangjiakou.aliyuncs.com/publicx/debian:11.7

MAINTAINER xuelingkang

ENV NGX_VERSION=1.22.0-1~buster

RUN apt-get update && \
    apt-get install -y curl gnupg gnupg1 gnupg2 && \
    echo "deb http://nginx.org/packages/debian/ buster nginx" | tee /etc/apt/sources.list.d/nginx.list && \
    curl -L http://nginx.org/keys/nginx_signing.key | apt-key add - && \
    apt-get remove --purge -y gnupg gnupg1 gnupg2 && \
    apt-get autoremove -y gnupg gnupg1 gnupg2 && \
    apt-get update && \
    apt-get install -y nginx=$NGX_VERSION && \
    apt-get clean

CMD ["nginx", "-g", "daemon off;"]

